<script setup>
import { inject } from 'vue'

//接收数据
const RoomData = inject('data-key')

//接收响应式数据
const CountData = inject('count-key')

//接收方法
const SetCount = inject('setcount-key')

</script>

<template>
<div>
    底层组件
</div>

<div>
    顶层接收数据：{{ RoomData }}
</div>
<div>
    顶层响应式数据：{{ CountData }}
</div>
<div>
    <button @click="SetCount">修改顶层的数据</button>
</div>
</template>